package com.wwt.server.imp;

import com.wwt.server.pojo.Role;
import com.wwt.server.mapper.RoleMapper;
import com.wwt.server.service.IRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Tao
 * @since 2021-12-05
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Autowired
    private RoleMapper roleMapper;
    //根据用户ID获取相应的角色列表
    @Override
    public List<Role> getRolesByAdminId(Integer adminId) {
        return roleMapper.getRolesByAdminId(adminId);
    }

    @Override
    public boolean deleteByRoleName(String roleName) {
        return roleMapper.deleteByRoleName(roleName);
    }
}
